/*
 * @Descripttion: your project
 * @version: 1.0
 * @Author: liuwen
 * @Date: 2023-08-05 10:41:17
 * @LastEditors: liuwen
 * @LastEditTime: 2023-09-01 16:02:31
 */

import request from '@/utils/request'


// 上传
export function uploadFile(data) {
  return request({
    url: '/prod-api/system/oss/upload',
    headers: {
      "Content-Type": "multipart/form-data"
    },
    method: 'post',
    data: data
  })
}

//生成取件码
export function genCode(data) {
  return request({
    url: '/prod-api/system/share/genCode',
    method: 'post',
    data: data
  })
}

//根据code获取文件列表
export function getListByCode(params) {
  return request({
    url: '/prod-api/system/file/getListByCode',
    method: 'get',
    params: params
  })
}

//我的文件
export function getMyList(params) {
  return request({
    url: `/prod-api/system/share/list`,
    method: 'get',
    params: params
  })
}

//下载文件
export const downloadFile = (id) => {
  return request({
      url: `/api/system/file/download/${id}`,
      method: 'get',
  })
}

//字典
export const getDict = () => {
  return request({
      url: `/prod-api/system/dict/data/type/file_exp`,
      method: 'get',
  })
}
